Fix up for change to Pango font API. #61933. (Untested, even for
authorOwen Taylor <otaylor@redhat.com>
Fri, 19 Oct 2001 16:26:09 +0000 (16:26 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 19 Oct 2001 16:26:09 +0000 (16:26 +0000)
Fri Oct 19 12:24:32 2001  Owen Taylor  <otaylor@redhat.com>

* gdk/linux-fb/gdkfont-fb.c: Fix up for change to
Pango font API. #61933. (Untested, even for compilation.)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/linux-fb/gdkfont-fb.c

index 3de59774ec1eddee10688b2fedec8f8f48d29b11..27f8b8ba8b545b2ea3891713686cc87355f25fbb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 19 12:24:32 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c: Fix up for change to 
+       Pango font API. #61933. (Untested, even for compilation.)
+
 Fri Oct 19 11:24:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkmain.[ch] (gtk_disable_setlocale): Actually
index 3de59774ec1eddee10688b2fedec8f8f48d29b11..27f8b8ba8b545b2ea3891713686cc87355f25fbb 100644 (file)
@@ -1,3 +1,8 @@
+Fri Oct 19 12:24:32 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c: Fix up for change to 
+       Pango font API. #61933. (Untested, even for compilation.)
+
 Fri Oct 19 11:24:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkmain.[ch] (gtk_disable_setlocale): Actually
index 3de59774ec1eddee10688b2fedec8f8f48d29b11..27f8b8ba8b545b2ea3891713686cc87355f25fbb 100644 (file)
@@ -1,3 +1,8 @@
+Fri Oct 19 12:24:32 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c: Fix up for change to 
+       Pango font API. #61933. (Untested, even for compilation.)
+
 Fri Oct 19 11:24:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkmain.[ch] (gtk_disable_setlocale): Actually
index 3de59774ec1eddee10688b2fedec8f8f48d29b11..27f8b8ba8b545b2ea3891713686cc87355f25fbb 100644 (file)
@@ -1,3 +1,8 @@
+Fri Oct 19 12:24:32 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c: Fix up for change to 
+       Pango font API. #61933. (Untested, even for compilation.)
+
 Fri Oct 19 11:24:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkmain.[ch] (gtk_disable_setlocale): Actually
index 3de59774ec1eddee10688b2fedec8f8f48d29b11..27f8b8ba8b545b2ea3891713686cc87355f25fbb 100644 (file)
@@ -1,3 +1,8 @@
+Fri Oct 19 12:24:32 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c: Fix up for change to 
+       Pango font API. #61933. (Untested, even for compilation.)
+
 Fri Oct 19 11:24:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkmain.[ch] (gtk_disable_setlocale): Actually
index 3de59774ec1eddee10688b2fedec8f8f48d29b11..27f8b8ba8b545b2ea3891713686cc87355f25fbb 100644 (file)
@@ -1,3 +1,8 @@
+Fri Oct 19 12:24:32 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c: Fix up for change to 
+       Pango font API. #61933. (Untested, even for compilation.)
+
 Fri Oct 19 11:24:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkmain.[ch] (gtk_disable_setlocale): Actually
index 3de59774ec1eddee10688b2fedec8f8f48d29b11..27f8b8ba8b545b2ea3891713686cc87355f25fbb 100644 (file)
@@ -1,3 +1,8 @@
+Fri Oct 19 12:24:32 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c: Fix up for change to 
+       Pango font API. #61933. (Untested, even for compilation.)
+
 Fri Oct 19 11:24:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkmain.[ch] (gtk_disable_setlocale): Actually
index 4d18b3c8a3a60844de3f008ee86a0d38506591eb..82b2db7c62ad5d429c4d5d4c656d56ee0a081653 100644 (file)
@@ -93,7 +93,7 @@ gdk_font_from_description (PangoFontDescription *desc)
   GdkFontPrivateFB *private;
   PangoFont *pango_font;
   PangoContext *context;
-  PangoFontMetrics metrics;
+  PangoFontMetrics *metrics;
   PangoLanguage *lang;
   
   g_return_val_if_fail (desc, NULL);
@@ -113,15 +113,14 @@ gdk_font_from_description (PangoFontDescription *desc)
   if (!pango_font)
     {
       desc = pango_font_description_copy (desc);
-      g_free (desc->family_name);
-      desc->family_name = g_strdup ("sans");
+      pango_font_description_set_family (desc, "sans");
       pango_font = pango_context_load_font (context, desc);
       if (!pango_font)
        {
-         desc->style = PANGO_STYLE_NORMAL;
-         desc->weight = PANGO_WEIGHT_NORMAL;
-         desc->variant = PANGO_VARIANT_NORMAL;
-         desc->stretch = PANGO_STRETCH_NORMAL;
+         pango_font_description_set_style (desc, PANGO_STYLE_NORMAL);
+         pango_font_description_set_weight (desc, PANGO_WEIGHT_NORMAL);
+         pango_font_description_set_variant (desc, PANGO_VARIANT_NORMAL);
+         pango_font_description_set_stretch (desc, PANGO_STRETCH_NORMAL);
          pango_font = pango_context_load_font (context, desc);
        }
       pango_font_description_free (desc);
@@ -135,20 +134,20 @@ gdk_font_from_description (PangoFontDescription *desc)
       return NULL;
     }
   
-  metrics.ascent = 0;
-  metrics.descent = 0;
   lang = pango_context_get_language (context);
-  pango_font_get_metrics (pango_font, lang, &metrics);
+  metrics = pango_font_get_metrics (pango_font, lang);
 
   private->pango_font = pango_font;
   
   g_free (lang);
   g_object_unref (G_OBJECT (context));
 
-  font->ascent = PANGO_PIXELS (metrics.ascent);
-  font->descent = PANGO_PIXELS (metrics.descent);
+  font->ascent = PANGO_PIXELS (metrics->ascent);
+  font->descent = PANGO_PIXELS (metrics->descent);
 
   g_assert ((font->ascent > 0) || (font->descent > 0));
+
+  pango_metrics_unref (metrics);
   
   return font;
 }
@@ -453,7 +452,7 @@ gdk_font_from_description (PangoFontDescription *font_desc)
 {
   g_return_val_if_fail (font_desc, NULL);
 
-  return gdk_fb_bogus_font (PANGO_PIXELS (font_desc->size));
+  return gdk_fb_bogus_font (PANGO_PIXELS (pango_font_description_get_size (font_desc)));
 }
 
 GdkFont*